home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 April / macformat-049.iso / mac / Shareware Plus / Developers / dropg++ / usr / include / scripts / vchain < prev    next >
Encoding:
Text File  |  1997-02-20  |  537 b   |  29 lines  |  [TEXT/R*ch]

  1. #    @(#)vchain    8.1 (Berkeley) 6/10/93
  2. #
  3. # Given a vnode, follow its mount pointers
  4. define vchain
  5.  
  6.     set $num = 0
  7.  
  8.     set $vp=(struct vnode *)$arg0
  9.     while ($vp)
  10.         printf "vp: 0x%x freef: 0x%x usecount: %d flags: 0x%x\n", $vp, $vp->v_freef, $vp->v_usecount, $vp->v_flag
  11.         set $num++
  12.         set $vp = $vp->v_mountf
  13.     end
  14.     printf "Number of vnodes: %d\n", $num
  15. end
  16.  
  17. define vprint
  18.     set $vp=(struct vnode *)$arg0
  19.     set $ip=(struct inode *)$vp->v_data
  20. end
  21.  
  22. define vall
  23.     set $mp=rootfs
  24.     while ($mp)
  25.         vchain $mp->mnt_mounth
  26.         set $mp=$mp->mnt_next
  27.     end
  28. end
  29.